<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="title">
            <h2><a href="#">Folha de Pagamento</a></h2>
        </ui:define>

        <ui:define name="body">
            <p:panel styleClass="container_24 clearfix">
                <div class="buttonAction" style="float: right">
                    <p:button value="Adicionar" href="criarfolhapagamento.xhtml" icon="ui-icon-plusthick"
                              styleClass="ui-priority-primary"/>
                    <p:button value="Pesquisar" href="pesquisarfolhapagamento.xhtml" icon="ui-icon-search"/>
                </div>
                <br/>
            </p:panel>

            <h:form id="folhaPagamentoForm" enctype="multipart/form-data">            
                <p:panel styleClass="container_24 clearfix">
                    <p:dataTable id="portariasTable" var="item" value="#{managerCriarFolhaPagamento.folhasPagamentos}" 
                                 styleClass="grid_24" emptyMessage="Nenhum registro">  
                        <f:facet name="header">
                            Declarações
                        </f:facet>

                        <p:column headerText="Ação" width="50">
                            <p:button title="Visualizar"
                                      href="visualizarfolhapagamento.xhtml?vFolhaPagamento=#{item.id}"
                                      icon="ui-icon-zoomin"/>
                        </p:column>

                        <p:column headerText="Data" width="130">
                            <h:outputLabel value="#{item.dataFolhaPagamento}">
                                <f:convertDateTime pattern="dd/MM/yyyy" />
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Secretaria">  
                            #{item.secretaria.nome}
                        </p:column> 

                    </p:dataTable>
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
